package com.jp.knowledge.util;

import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

/**
 * Created by jiayen on 16/12/1.
 */

public class KeyBordUtil {

    /**
     * 隐藏软键盘
     */
    public static void hideSoftAndEdit(EditText edit) {
        InputMethodManager inputManager = (InputMethodManager) edit.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        if (inputManager!=null&&inputManager.isActive())
            inputManager.hideSoftInputFromWindow(edit.getWindowToken(), 0);

    }
}
